package com.longcai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.longcai.entity.auth.SysShopsRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZJ
 * @since 2019-03-16
 */
@Mapper
@Repository
public interface SysShopsRoleMapper extends BaseMapper<SysShopsRole> {

    @Select("select * from sys_shops_role r inner join sys_shops_role_user ru on r.id = ru.roleId where ru.userId = #{userId}")
    List<SysShopsRole> listByUserId(String userId);
}
